package com.tools;

import com.entity.Students;
import com.servlet.SelectAll;

import java.util.List;

public class test {
    //测试连接与数据交互
    public static void main(String[] args) {
        /*try {
            Class.forName("com.mysql.jdbc.Driver");
            try(Connection conn= DriverManager.getConnection(
                    "jdbc:mysql://192.168.56.99:3306/temp",
                    "root",
                    "root");
                PreparedStatement stat=conn.prepareStatement("SELECT * FROM students")) {
                ResultSet res=stat.executeQuery();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }*/

        SelectAll selectAll =new SelectAll();
        List<Students> list=selectAll.getList();
        for (Students students : list) {
             System.out.println(students.getSname());
        }
    }

}
